COMP       = gcc
COMP_FLAGS = -Wall -pedantic
LIB        = -lfl

FLEX_EX     = flex_example

xxxall: flex_ex1 flex_ex2

flex_ex1:
	flex -o ${FLEX_EX}1/${FLEX_EX}1.c ${FLEX_EX}1/${FLEX_EX}1.l 
	${COMP} ${COMP_FLAGS} ${FLEX_EX}1/${FLEX_EX}1.c -o ${FLEX_EX}1_exe ${LIB}

flex_ex2:
	flex -o ${FLEX_EX}2/${FLEX_EX}2.c ${FLEX_EX}2/${FLEX_EX}2.l 
	${COMP} ${COMP_FLAGS} ${FLEX_EX}2/${FLEX_EX}2.c -o ${FLEX_EX}2_exe ${LIB}
	
flex_ex3:
	flex -o ${FLEX_EX}3/${FLEX_EX}3.c ${FLEX_EX}3/${FLEX_EX}3.l 
	${COMP} ${COMP_FLAGS} ${FLEX_EX}3/${FLEX_EX}3.c -o ${FLEX_EX}3_exe ${LIB}

clean:
	rm *_exe */${FLEX_EX}*.c